const common = require('./webpack.common');
const { merge } = require('webpack-merge');
const webpack = require('webpack')


module.exports = merge(common, {
  mode: 'development',
  devtool: 'eval-cheap-module-source-map',
  devServer: {
    // 通过 contentBase 指定额外的静态资源查找目录
    contentBase: ['public', 'src/assets'],
    // 通过将 hot 设置为 true, 来开启 HMR 热更新
    // hot: true,
    // hotOnly 只有在热替换后任然是正常的代码才会进行热更新
    hotOnly: true,
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
  ]
})